package com.wlyuan.index.api.waybill.dto;

import com.wlyuan.transport.dto.AddressDTO;
import com.wlyuan.transport.dto.common.ContactDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author yuanjie
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class WaybillRouteDivideDTO extends WaybillDivideDTO<WaybillRouteDivideDTO.Divide> {

    @Data
    public static class Divide implements IDivide, Serializable {
        @ApiModelProperty("承运方ID")
        private Long carrierId;

        @ApiModelProperty("站点名称")
        private String stationName;

        @Valid
        @ApiModelProperty("中转地址")
        @NotNull(message = "中转地址不能为空")
        private AddressDTO address;

        @Valid
        @ApiModelProperty("联系人")
        @NotNull(message = "联系人信息不能为空")
        private ContactDTO contact;

        @ApiModelProperty("要求收货时间")
        @NotNull(message = "要求收货时间不能为空")
        private LocalDateTime toTime;
    }

    @Valid
    private List<Divide> divides;
}
